* Set current directory and open log
cd "E:\Seagate Sync\VOL\Personal folder\Documents\Research\Current projects\Working party meetings\Posted\EUP 160404"
capture log close


**************************************************************************************
* Generate datasets of working party meeting duration at various levels of aggregation
**************************************************************************************


* Project and author information
********************************
* Programme:	wpar-management00.do
* Date:			4 April 2016
* Author:		Frank Haege, University of Limerick
* Contact:		frank.haege@ul.ie 

* Do-file description
*********************
* This do-file runs all do-files in order to create working party meeting duration datasets
* from the original Excel files at various levels of aggregation.

* Note:
******* 
* In order for this do-file to run smoothly, the file path of the 'cd' command (specifying the currend directory at the beginning of the do-file)
* needs to be changed in ALL do-files to point to the top-level folder address to which the replication files 
* have been copied. Also, the existing folder structure of the replication files should not be changed.


* Clear memory  
**************
version 12.0
clear all
macro drop _all
set more off


* Run do-files
**************

* Formatting of working party lifecycle data
run "Data management\worg-management01.do"

* Separate Coreper and Council meetings from working party meetings for 2011 to 2014 period
run "Data management\wpar-management01-separate.do"

* Clean and format Council meetings; generate data sets at various levels of aggregation
run "Data management\wpar-management02-council.do"

* Clean and format Coreper meetings; generate data sets at various levels of aggregation
run "Data management\wpar-management03-coreper.do"

* Clean and format working party meetings
run "Data management\wpar-management04-workingparties01-clean.do"

* Code working party titles
run "Data management\wpar-management05-workingparties02-code.do"

* Remove duplicates and generate additional observations for joint meetings
run "Data management\wpar-management06-workingparties03-merge.do"

* Prepare lifecycle data for merge with meeting data
run "Data management\wpar-management07-wplife-prepare.do"

* Merge meeting data with lifecycle data; perform consistency checks and corrections
run "Data management\wpar-management08-merge.do"

* Finalise meeting level data set and create aggregated data sets
run "Data management\wpar-management09-reshape.do"


* Close log and exit
exit



